gtk4.git
9 years agoGtkListBox: Convert to indirect rendering
Matthias Clasen [Sun, 7 Aug 2016 00:27:30 +0000 (20:27 -0400)]
GtkListBox: Convert to indirect rendering

Note that there is a problem with the pixel cache that causes
listboxes to come out black when in a scrolled window.

9 years agogadget: Fix handling of custom content
Matthias Clasen [Sun, 7 Aug 2016 00:02:49 +0000 (20:02 -0400)]
gadget: Fix handling of custom content

The transformations here were wrong, causing content to go nowhere.
This patch fixes check and radio buttons to appear as expected.

9 years agoGtkCheckButton: Convert to indirect rendering
Matthias Clasen [Sat, 6 Aug 2016 23:35:03 +0000 (19:35 -0400)]
GtkCheckButton: Convert to indirect rendering

This is another example of indirect rendering with a box gadget.
There is currently still some positioning problem with the
checkmark.

9 years agoPrevent box gadget content from being drawn twice
Matthias Clasen [Sat, 6 Aug 2016 23:33:47 +0000 (19:33 -0400)]
Prevent box gadget content from being drawn twice

Now that we split out box gadget children into separate
render nodes, we must not draw them onto the box gadgets
node anymore.

9 years agoGtkExpander: Convert to indirect rendering
Matthias Clasen [Sat, 6 Aug 2016 23:05:14 +0000 (19:05 -0400)]
GtkExpander: Convert to indirect rendering

This is the first example of indirect rendering involving
a box gadget. For now, we iterate the child gadgets manually,
and rely on gtk_container_propagate_render_node for the
child widgets. Eventually, we may want a better solution
here.

9 years agogadget: Add a has_content vfunc
Matthias Clasen [Sat, 6 Aug 2016 21:23:24 +0000 (17:23 -0400)]
gadget: Add a has_content vfunc

...and implement it for GtkCssGadget and GtkCssCustomGadget.
This allows us to decide on a per-object basis if a custom
gadget needs a render node for content or not.

9 years agobutton: Restore focus
Matthias Clasen [Sat, 6 Aug 2016 14:34:18 +0000 (10:34 -0400)]
button: Restore focus

The custom gadget draw function has the side effect of informing
the gadget machinery wether to draw focus or not. Bring the
draw function back, just for its boolean return value. We may
want to find a better solution for this.

9 years agoAllow selective debug spew
Matthias Clasen [Sat, 6 Aug 2016 14:24:05 +0000 (10:24 -0400)]
Allow selective debug spew

I don't think this should stay in the code long-term, but it
is useful for debugging. It helped me track down some suspicious
placements of render nodes.

9 years agoAdd details to css render nodes
Matthias Clasen [Sat, 6 Aug 2016 14:23:20 +0000 (10:23 -0400)]
Add details to css render nodes

Give all nodes the same detail about the owner widget.
This reveals that every GtkCssCustomGadget gets a
DrawGadgetContents node, even if their draw_func is NULL.
We may want to come up with a better solution for that.

9 years agoSome debug help
Matthias Clasen [Sat, 6 Aug 2016 13:37:47 +0000 (09:37 -0400)]
Some debug help

Make the bounds of drawing surfaces created by render nodes visible.

Trigger with GSK_DEBUG=surface.

9 years agoDrop an unused variable
Matthias Clasen [Fri, 5 Aug 2016 12:13:53 +0000 (08:13 -0400)]
Drop an unused variable

9 years agogtk: Clean up render fallback node creation in GtkWidget
Emmanuele Bassi [Thu, 4 Aug 2016 18:19:46 +0000 (19:19 +0100)]
gtk: Clean up render fallback node creation in GtkWidget

9 years agogtk: Port GtkHeaderBar to render nodes
Emmanuele Bassi [Thu, 4 Aug 2016 18:19:14 +0000 (19:19 +0100)]
gtk: Port GtkHeaderBar to render nodes

9 years agogtk: Port GtkActionBar to render nodes
Emmanuele Bassi [Thu, 4 Aug 2016 18:18:58 +0000 (19:18 +0100)]
gtk: Port GtkActionBar to render nodes

9 years agogtk: Attempt at handling CSS coordinates
Emmanuele Bassi [Thu, 4 Aug 2016 18:16:43 +0000 (19:16 +0100)]
gtk: Attempt at handling CSS coordinates

When creating the GskRenderNodes for the gadgets we should not translate
the coordinates inside the Cairo context, but we should tweak the
coordinates of the anchor point.

This is still not enough to get an appropriate rendering, as the result
is still slightly offset to the left.

9 years agogsk: Pass the appropriate value for the n_quads argument
Emmanuele Bassi [Thu, 4 Aug 2016 18:14:51 +0000 (19:14 +0100)]
gsk: Pass the appropriate value for the n_quads argument

Instead of passing the size of the buffer, we should pass the number of
quads; we know what the size of a single quad structure is, so we can do
the multiplication internally when creating the VAO.

This allows us to print the quads for debugging purposes.

9 years agoGtkFrame: Convert to indirect rendering
Matthias Clasen [Wed, 3 Aug 2016 01:26:03 +0000 (21:26 -0400)]
GtkFrame: Convert to indirect rendering

Create a GskRenderNode for the contents of the frame.

9 years agogtk: Add convenience function for creating render nodes
Emmanuele Bassi [Thu, 4 Aug 2016 14:22:00 +0000 (15:22 +0100)]
gtk: Add convenience function for creating render nodes

GtkWidget.create_render_node() sets up a GskRenderNode appropriate for
rendering the contents of a widget, including its bounds,
transformation, and anchor point.

9 years agogsk: Rename set_offset() to set_anchor_point()
Emmanuele Bassi [Thu, 4 Aug 2016 14:20:06 +0000 (15:20 +0100)]
gsk: Rename set_offset() to set_anchor_point()

The naming is consistent with other scene graph libraries, as it
represents an additional translation transformation applied on top of
the provided transformation matrices.

We can also simplify the implementation by applying the translation when
we compute the world matrix.

9 years agogsk: Recycle textures across frames
Emmanuele Bassi [Thu, 4 Aug 2016 11:37:54 +0000 (12:37 +0100)]
gsk: Recycle textures across frames

We keep the textures used inside a frame around until the end of the
following frame; whenever we need a texture with the same size, and
it's not marked in use, then we just reuse the existing texture.

9 years agoFix fallback render nodes
Matthias Clasen [Thu, 4 Aug 2016 05:05:14 +0000 (01:05 -0400)]
Fix fallback render nodes

We were allocating a surface thats big enough for the clip, and
we were setting the transform for that, but then GtkContainer
was overriding the transform with the one for the allocation.
Also, we were drawing at the clip position, not the allocation
position.

9 years agoAdd an offset to render nodes
Matthias Clasen [Thu, 4 Aug 2016 05:04:25 +0000 (01:04 -0400)]
Add an offset to render nodes

This will let us account for the difference between
clip and allocation.

9 years agogsk: Split of debug spew for transforms
Matthias Clasen [Wed, 3 Aug 2016 02:00:50 +0000 (22:00 -0400)]
gsk: Split of debug spew for transforms

This was overwhelming other useful debug output, so make it
opt-in. We print the render items for both opengl and transforms,
since the matrices bleed into each other, otherwise.

9 years agogsk: Add debug macros that trigger on two conditions
Matthias Clasen [Wed, 3 Aug 2016 01:56:17 +0000 (21:56 -0400)]
gsk: Add debug macros that trigger on two conditions

This will be useful in the following commits.

9 years agogsk: Add a debug flag for transforms
Matthias Clasen [Wed, 3 Aug 2016 01:53:31 +0000 (21:53 -0400)]
gsk: Add a debug flag for transforms

9 years agogsk: Improve debug output a bit
Matthias Clasen [Wed, 3 Aug 2016 01:52:30 +0000 (21:52 -0400)]
gsk: Improve debug output a bit

Indent render node debug spew to make the tree structure obvious.

9 years agobutton: Convert to indirect rendering
Matthias Clasen [Wed, 3 Aug 2016 00:13:21 +0000 (20:13 -0400)]
button: Convert to indirect rendering

WARNING! This commit breaks GtkButton subclasses.

9 years agoConvert GtkGrid to indirect rendering
Matthias Clasen [Tue, 2 Aug 2016 23:45:47 +0000 (19:45 -0400)]
Convert GtkGrid to indirect rendering

Following the example of GtkBox.

9 years agogsk: Add GskProfiler to GskRenderer
Emmanuele Bassi [Wed, 3 Aug 2016 15:51:21 +0000 (16:51 +0100)]
gsk: Add GskProfiler to GskRenderer

The profiler instance is per-renderer, and is accesible to
implementations.

9 years agogsk: Add profiler object
Emmanuele Bassi [Wed, 3 Aug 2016 15:48:49 +0000 (16:48 +0100)]
gsk: Add profiler object

The GskProfiler holds counters and timers, and will be used by the
renderer implementations to acquire frame timings.

9 years agobox: Port from immediate to deferred rendering
Emmanuele Bassi [Tue, 2 Aug 2016 17:44:06 +0000 (18:44 +0100)]
box: Port from immediate to deferred rendering

Drop the ::draw() vfunc implementation in favour of the
::get_render_node() vfunc.

9 years agoIntegrate CSS gadget with GSK render nodes
Emmanuele Bassi [Tue, 2 Aug 2016 17:42:51 +0000 (18:42 +0100)]
Integrate CSS gadget with GSK render nodes

First stab at an internal API that generates render nodes when drawing a
CSS gadget.

9 years agogtk: Update the coordinates when propagating render nodes
Emmanuele Bassi [Tue, 2 Aug 2016 16:01:08 +0000 (17:01 +0100)]
gtk: Update the coordinates when propagating render nodes

Just like gtk_container_propagate_draw() does for the immediate mode
rendering.

9 years agoUse the projection to flip around the content
Emmanuele Bassi [Tue, 2 Aug 2016 15:58:47 +0000 (16:58 +0100)]
Use the projection to flip around the content

Since we use an FBO to render the contents of the render node tree, the
coordinate space is going to be flipped in GL. We can undo the flip by
using an appropriate projection matrix, instead of changing the sampling
coordinates in the shaders and updating all our coordinates at render
time.

9 years agowidget: Fix compatibility fallbacks
Emmanuele Bassi [Mon, 1 Aug 2016 15:19:31 +0000 (16:19 +0100)]
widget: Fix compatibility fallbacks

9 years agogsk: Add texture size to debug message
Emmanuele Bassi [Thu, 28 Jul 2016 15:20:26 +0000 (16:20 +0100)]
gsk: Add texture size to debug message

9 years agogsk: Take into account the scaling factor
Emmanuele Bassi [Wed, 27 Jul 2016 15:48:35 +0000 (16:48 +0100)]
gsk: Take into account the scaling factor

We need to apply a scaling factor whenever we deal with user-supplied
coordinates, like:

 - when creating textures
 - when setting up the viewport
 - when submitting the scene

9 years agogsk: Tie render nodes to renderers
Emmanuele Bassi [Wed, 27 Jul 2016 15:23:44 +0000 (16:23 +0100)]
gsk: Tie render nodes to renderers

Render nodes need access to rendering information like scaling factors.
If we keep render nodes separate from renderers until we submit a nodes
tree for rendering we're going to have to duplicate all that information
in a way that makes the API more complicated and fuzzier on its
semantics.

By having GskRenderer create GskRenderNode instances we can tie nodes
and renderers together; since higher layers will also have access to
the renderer instance, this does not add any burden to callers.

Additionally, if memory measurements indicate that we are spending too
much time in the allocation of new render nodes, we can now easily
implement a free-list or a renderer-specific allocator without breaking
the API.

9 years agogsk: Bind GL context to the GL profiler
Emmanuele Bassi [Wed, 27 Jul 2016 10:34:20 +0000 (11:34 +0100)]
gsk: Bind GL context to the GL profiler

Similarly to how we bind it to the GL driver object used by the GSK GL
renderer.

9 years agogtk: Port GtkWindow to render nodes
Emmanuele Bassi [Wed, 27 Jul 2016 08:42:25 +0000 (09:42 +0100)]
gtk: Port GtkWindow to render nodes

WARNING: BROKEN COMMIT

9 years agogtk: Add GtkContainer API to gather render nodes
Emmanuele Bassi [Wed, 27 Jul 2016 08:40:29 +0000 (09:40 +0100)]
gtk: Add GtkContainer API to gather render nodes

We cannot implement GtkWidgetClass.get_render_node() in GtkContainer
without breaking the fallback path that renders a widget to a single
render node rasterization. For GtkContainer subclasses we should provide
a simple API, similar to gtk_container_propagate_draw(), that gathers
all the render nodes for each child.

9 years agogtk: Name GSK render nodes
Emmanuele Bassi [Wed, 27 Jul 2016 08:39:55 +0000 (09:39 +0100)]
gtk: Name GSK render nodes

For debugging purposes it's helpful to name the nodes.

9 years agogsk: Fix build without Wayland
Emmanuele Bassi [Mon, 25 Jul 2016 16:36:33 +0000 (17:36 +0100)]
gsk: Fix build without Wayland

9 years agogsk: Add redirection to FBOs for opacity groups
Emmanuele Bassi [Mon, 25 Jul 2016 16:15:05 +0000 (17:15 +0100)]
gsk: Add redirection to FBOs for opacity groups

If a node is non-opaque and has a non-zero opacity we need to paint its
contents and children first to an off screen buffer, and then render the
resulting texture at the desired opacity — otherwise the opacities will
combine and result in the wrong rendering.

9 years agogsk: Drop opaque/transparent item split
Emmanuele Bassi [Thu, 21 Jul 2016 16:19:53 +0000 (17:19 +0100)]
gsk: Drop opaque/transparent item split

We're not going to use separate rendering lists soon, and the way we
render items is less similar to a gaming engine and more similar to a
simpler compositor. This means we don't need to perform a two pass
rendering — opaque items first, transparent items later.

9 years agogsk: Rename uniforms and attributes in shaders
Emmanuele Bassi [Thu, 21 Jul 2016 16:17:49 +0000 (17:17 +0100)]
gsk: Rename uniforms and attributes in shaders

Use appropriate names, and annotate the names with the types — 'u' for
uniforms, 'a' for attributes. The common preambles for shaders are split
from the bodies, so we need some way to distinguish the uniforms and the
attributes just from their name.

9 years agogsk: Move resource handling inside GskGLDriver
Emmanuele Bassi [Wed, 20 Jul 2016 16:55:35 +0000 (17:55 +0100)]
gsk: Move resource handling inside GskGLDriver

We want the GL driver to cache as many resources as possible, so we can
always ensure that we're in a consistent state, and we can handle state
transitions more appropriately.

9 years agogsk: Simplify buffer handling in GskGLRenderer
Emmanuele Bassi [Tue, 19 Jul 2016 13:42:54 +0000 (14:42 +0100)]
gsk: Simplify buffer handling in GskGLRenderer

We don't have optional stencil and depth buffers, like GtkGLArea: we
always create both of them internally.

9 years agogsk: Drop render buffer code path from GskGLRenderer
Emmanuele Bassi [Tue, 19 Jul 2016 13:34:24 +0000 (14:34 +0100)]
gsk: Drop render buffer code path from GskGLRenderer

We always use texturing, to preserve the alpha channel when blitting the
frame buffer object on the window surface.

9 years agogsk: Rework surface -> texture API
Emmanuele Bassi [Tue, 19 Jul 2016 13:32:17 +0000 (14:32 +0100)]
gsk: Rework surface -> texture API

Drop the texture parameters handling from the texture creation, and
associate them with the contents upload. Also, rename the function to
something more in line with what it does.

9 years agogsk: Add GL driver API to create render targets
Emmanuele Bassi [Tue, 12 Jul 2016 14:41:31 +0000 (15:41 +0100)]
gsk: Add GL driver API to create render targets

It's going to be used by the GL renderer to safely create and bind
FBOs when needed.

9 years agogsk: Turn texture cache into a hash table
Emmanuele Bassi [Tue, 12 Jul 2016 13:59:37 +0000 (14:59 +0100)]
gsk: Turn texture cache into a hash table

We want to add the list of FBOs tied to a texture; this means we cannot
trivally copy the Texture structure when adding it to a GArray. We're
also going to have more textures than VAOs, so it makes more sense to
use a O(1) access data structure for them.

9 years agogsk: Add GL profiler
Emmanuele Bassi [Tue, 12 Jul 2016 13:50:48 +0000 (14:50 +0100)]
gsk: Add GL profiler

We can use the GL_ARB_timer_query extension (available since OpenGL
3.2, and part of the OpenGL specification since version 3.3) to query
the time elapsed when drawing each frame. This allows us to gather
timing information on our use of the GPU.

9 years agogsk: Split surface upload from texture creation
Emmanuele Bassi [Tue, 12 Jul 2016 10:15:45 +0000 (11:15 +0100)]
gsk: Split surface upload from texture creation

We're going to need a method to create textures without a surface.

9 years agogsk: Enable depth testing
Emmanuele Bassi [Fri, 8 Jul 2016 15:40:42 +0000 (16:40 +0100)]
gsk: Enable depth testing

Use the appropriate depth testing function for transparent items.

9 years agogsk: Use consistent naming for blend fragment shader
Emmanuele Bassi [Fri, 8 Jul 2016 15:26:44 +0000 (16:26 +0100)]
gsk: Use consistent naming for blend fragment shader

This should make it immediately clear if we're doing something wrong.

9 years agogsk: Fix pre-condition check
Emmanuele Bassi [Fri, 8 Jul 2016 15:24:35 +0000 (16:24 +0100)]
gsk: Fix pre-condition check

We warn if the node is marked as not mutable.

9 years agogsk: Flip mutability on GskRenderNode.finalize
Emmanuele Bassi [Fri, 8 Jul 2016 15:23:49 +0000 (16:23 +0100)]
gsk: Flip mutability on GskRenderNode.finalize

We use the public API when removing children nodes, so we need to mark
the node as mutable while we destroy it.

9 years agogsk: Add specific debug type for shaders
Emmanuele Bassi [Fri, 8 Jul 2016 15:22:33 +0000 (16:22 +0100)]
gsk: Add specific debug type for shaders

So that we don't lose GskShaderBuilder debugging messages in the stream
of GskGLRenderer ones.

9 years agogsk: Add GskGLDriver
Emmanuele Bassi [Fri, 8 Jul 2016 15:21:13 +0000 (16:21 +0100)]
gsk: Add GskGLDriver

We can move the caching and management of textures, VAOs, and state of
the GL machinery into a single object, GskGLDriver.

9 years agogsk: Use the right pointer to the parent RenderItem
Emmanuele Bassi [Wed, 6 Jul 2016 16:10:12 +0000 (17:10 +0100)]
gsk: Use the right pointer to the parent RenderItem

We copy the local RenderItem into the render items array, so we need to
use the copy in the array in order to get the correct reference.

9 years agoEnsure that render nodes are translated
Emmanuele Bassi [Tue, 5 Jul 2016 10:58:44 +0000 (11:58 +0100)]
Ensure that render nodes are translated

The clip rectangle may have non-zero offsets, so we need to ensure that
the GskRenderNode associated to the rendered area is translated by those
same offsets.

9 years agogsk: Add fundamental type annotations for GskRenderNode
Emmanuele Bassi [Mon, 4 Jul 2016 13:07:24 +0000 (14:07 +0100)]
gsk: Add fundamental type annotations for GskRenderNode

We need to annotate the GskRenderNode so that the introspection
machinery can find the functions for managing reference counting
and GValues.

9 years agogsk: Add 'blit' program
Emmanuele Bassi [Mon, 4 Jul 2016 12:55:00 +0000 (13:55 +0100)]
gsk: Add 'blit' program

For the root node we do not need to use blending, as it does not have
any backdrop to blend into. We can use a simpler 'blit' program that
only takes the content of the source and fills the texture quad with
it.

9 years agogsk: Consolidate program creation and storage
Emmanuele Bassi [Mon, 4 Jul 2016 12:46:22 +0000 (13:46 +0100)]
gsk: Consolidate program creation and storage

We should use ShaderBuilder to create and store programs for the GL
renderer. This allows us to simplify the creation of programs (by moving
the compilation phase into the ShaderBuilder::create_program() method),
and move towards the ability to create multiple programs and just keep a
reference to the program id.

9 years agodocs: Add more GSK documentation
Emmanuele Bassi [Sun, 3 Jul 2016 23:23:19 +0000 (00:23 +0100)]
docs: Add more GSK documentation

9 years agogsk: Add more modes to the blend shader
Emmanuele Bassi [Sun, 3 Jul 2016 22:02:56 +0000 (23:02 +0100)]
gsk: Add more modes to the blend shader

Use the compositing CSS spec at:

  https://www.w3.org/TR/compositing-1/#blending

For the implementation.

9 years agogsk: Don't store the uniform and attribute location twice
Emmanuele Bassi [Sun, 3 Jul 2016 21:54:30 +0000 (22:54 +0100)]
gsk: Don't store the uniform and attribute location twice

We should keep the ShaderBuilder around and use it to query the various
uniform and attribute locations when needed, instead of storing those
offsets into the Renderer instance, and copying them. This allows a bit
more flexibility, once we have more than one program built into the
renderer.

9 years agogsk: Add getter for program id in ShaderBuilder
Emmanuele Bassi [Sun, 3 Jul 2016 21:53:16 +0000 (22:53 +0100)]
gsk: Add getter for program id in ShaderBuilder

Since we store it into the ShaderBuilder instance we should also allow
getting the program id.

9 years agogsk: Add debugging notes to ShaderBuilder
Emmanuele Bassi [Sun, 3 Jul 2016 21:38:27 +0000 (22:38 +0100)]
gsk: Add debugging notes to ShaderBuilder

Print out the generated shader and the list of available uniforms and
attributes.

9 years agogsk: Rework how GLSL shaders are built
Emmanuele Bassi [Sun, 3 Jul 2016 20:12:22 +0000 (21:12 +0100)]
gsk: Rework how GLSL shaders are built

The GL renderer should build the GLSL shaders using GskShaderBuilder.
This allows us to separate the common parts into separate files, and
assemble them as necessary, instead of shipping one big shader per type
of GL API (GL3, GL legacy, and GLES).

9 years agogsk: Add ShaderBuilder
Emmanuele Bassi [Sun, 3 Jul 2016 19:04:40 +0000 (20:04 +0100)]
gsk: Add ShaderBuilder

GskShaderBuilder is an ancillary, private type that deals with the
internals of taking GLSL shaders from resources and building them,
with the additional feature of being able to compose shaders from a
common preamble, as well as adding conditional defines (useful for
enabling debugging code in the shaders themselves).

9 years agogsk: Add rendering debug mode for shaders
Emmanuele Bassi [Sun, 3 Jul 2016 17:59:32 +0000 (18:59 +0100)]
gsk: Add rendering debug mode for shaders

It's going to be useful to inject debugging data into the shaders used
by GSK.

9 years agogdk: Add more GDK_GL_ERROR error ids
Emmanuele Bassi [Fri, 1 Jul 2016 15:17:14 +0000 (16:17 +0100)]
gdk: Add more GDK_GL_ERROR error ids

We're going to use them in other locations.

9 years agogsk: Use the node's blend mode in the GL renderer
Emmanuele Bassi [Fri, 1 Jul 2016 11:15:56 +0000 (12:15 +0100)]
gsk: Use the node's blend mode in the GL renderer

9 years agogsk: Store blend mode in the render node
Emmanuele Bassi [Fri, 1 Jul 2016 11:12:30 +0000 (12:12 +0100)]
gsk: Store blend mode in the render node

9 years agogsk: Make GskBlendMode enumeration public
Emmanuele Bassi [Fri, 1 Jul 2016 11:02:43 +0000 (12:02 +0100)]
gsk: Make GskBlendMode enumeration public

9 years agogsk: Allow sampling between parent and child nodes
Emmanuele Bassi [Thu, 30 Jun 2016 16:06:31 +0000 (17:06 +0100)]
gsk: Allow sampling between parent and child nodes

9 years agogsk: Group render state attributes
Emmanuele Bassi [Thu, 30 Jun 2016 14:07:16 +0000 (15:07 +0100)]
gsk: Group render state attributes

9 years agogsk: Turn GskRenderNode into a pure GTypeInstance
Emmanuele Bassi [Wed, 29 Jun 2016 18:05:33 +0000 (19:05 +0100)]
gsk: Turn GskRenderNode into a pure GTypeInstance

Using GObject as the base type for a transient tree may prove to be too
intensive, especially when creating a lot of node instances. Since we
don't need properties or signals, and we don't need complex destruction
semantics, we can use GTypeInstance directly as the base type for
GskRenderNode.

9 years agogtk: Use GskRenderNode to render widgets
Emmanuele Bassi [Thu, 23 Jun 2016 16:35:42 +0000 (17:35 +0100)]
gtk: Use GskRenderNode to render widgets

We need a virtual function to retrieve the GskRenderNode for each
widget, which is supposed to attach its own children's GskRenderNodes.
Additionally, we want to maintain the existing GtkWidget::draw mechanism
for widgets that do not implement get_render_node() — as well as widgets
that have handlers connected to the ::draw signal.

9 years agogtk: Add a GskRenderer to GtkWindow
Emmanuele Bassi [Thu, 23 Jun 2016 16:34:38 +0000 (17:34 +0100)]
gtk: Add a GskRenderer to GtkWindow

Each top-level should have its own GskRenderer, to be used when drawing
the render node tree.

9 years agogsk: Rework GskRenderer and GskRenderNode semantics
Emmanuele Bassi [Wed, 22 Jun 2016 16:30:36 +0000 (17:30 +0100)]
gsk: Rework GskRenderer and GskRenderNode semantics

This commit changes the way GskRenderer and GskRenderNode interact and
are meant to be used.

GskRenderNode should represent a transient tree of rendering nodes,
which are submitted to the GskRenderer at render time; this allows the
renderer to take ownership of the render tree. Once the toolkit and
application code have finished assembling it, the render tree ownership
is transferred to the renderer.

9 years agogsk: Flush the GL render items cache
Emmanuele Bassi [Tue, 26 Apr 2016 13:23:12 +0000 (14:23 +0100)]
gsk: Flush the GL render items cache

Whenever the render tree changes we want to drop the RenderItem arrays,
as each item contains a pointer to the GskRenderNode which becomes
dangling once the root node changed.

9 years agogsk: Add GskRenderer::clear_tree
Emmanuele Bassi [Tue, 26 Apr 2016 13:22:25 +0000 (14:22 +0100)]
gsk: Add GskRenderer::clear_tree

We need a way to clear eventual caches inside GskRenderer subclasses if
the root node has changed.

9 years agogsk: Port GskGLRenderer to GLES
Emmanuele Bassi [Mon, 25 Apr 2016 11:26:46 +0000 (12:26 +0100)]
gsk: Port GskGLRenderer to GLES

Use the appropriate API and shaders if the GdkGLContext was created for
OpenGL ES instead of OpenGL.

9 years agogsk: Use surface-to-texture utility function
Emmanuele Bassi [Mon, 25 Apr 2016 10:41:15 +0000 (11:41 +0100)]
gsk: Use surface-to-texture utility function

Now that we have it.

9 years agogsk: Rename shaders for OpenGL
Emmanuele Bassi [Mon, 25 Apr 2016 10:09:25 +0000 (11:09 +0100)]
gsk: Rename shaders for OpenGL

9 years agogdk: Add utility for uploading Cairo surfaces to GL
Emmanuele Bassi [Mon, 25 Apr 2016 10:29:14 +0000 (11:29 +0100)]
gdk: Add utility for uploading Cairo surfaces to GL

The surface-to-GL upload logic has become more complicated with the
addition of the GLES code paths; it's more logical to have a public
utility function that can be called from GDK users, instead of copy
pasting the whole thing multiple times.

9 years agobuild: Add GSK deps to GTK
Emmanuele Bassi [Wed, 20 Apr 2016 15:00:45 +0000 (16:00 +0100)]
build: Add GSK deps to GTK

9 years agoInitial implementation of GSK rendering pipeline
Emmanuele Bassi [Thu, 17 Mar 2016 13:48:19 +0000 (13:48 +0000)]
Initial implementation of GSK rendering pipeline

GSK is conceptually split into two scene graphs:

 * a simple rendering tree of operations
 * a complex set of logical layers

The latter is built on the former, and adds convenience and high level
API for application developers.

The lower layer, though, is what gets transformed into the rendering
pipeline, as it's simple and thus can be transformed into appropriate
rendering commands with minimal state changes.

The lower layer is also suitable for reuse from more complex higher
layers, like the CSS machinery in GTK, without necessarily port those
layers to the GSK high level API.

This lower layer is based on GskRenderNode instances, which represent
the tree of rendering operations; and a GskRenderer instance, which
takes the render nodes and submits them (after potentially reordering
and transforming them to a more appropriate representation) to the
underlying graphic system.

9 years agogsk: Initial commit / build environment
Emmanuele Bassi [Tue, 14 Jan 2014 13:01:35 +0000 (13:01 +0000)]
gsk: Initial commit / build environment

9 years agolabel: Avoid shadowing variables
Emmanuele Bassi [Tue, 18 Oct 2016 10:29:06 +0000 (11:29 +0100)]
label: Avoid shadowing variables

9 years agoUpdate POTFILES.in
Piotr Drąg [Tue, 18 Oct 2016 01:50:55 +0000 (03:50 +0200)]
Update POTFILES.in

9 years agoAdd a test for cursor names
Matthias Clasen [Mon, 17 Oct 2016 19:28:29 +0000 (15:28 -0400)]
Add a test for cursor names

This tests both that all standard cusor yield a cursor, and that
unknown cursor names yield NULL.

9 years agox11: Add the same message as the wayland backend has
Matthias Clasen [Mon, 17 Oct 2016 19:27:15 +0000 (15:27 -0400)]
x11: Add the same message as the wayland backend has

This seems prudent, if we make noise about missing cursors
on Wayland, we should do the same on X11.

9 years agoReduce a warning to a message
Matthias Clasen [Mon, 17 Oct 2016 19:26:29 +0000 (15:26 -0400)]
Reduce a warning to a message

The warning interferes with having a testcase to check this behavior,
so reduce this to a message.

9 years agoRemove GtkAction
Timm Bäder [Sun, 16 Oct 2016 18:56:47 +0000 (20:56 +0200)]
Remove GtkAction

9 years agoRemove GtkActionGroup
Timm Bäder [Sun, 16 Oct 2016 18:46:37 +0000 (20:46 +0200)]
Remove GtkActionGroup

9 years agoFix unittests
Timm Bäder [Mon, 17 Oct 2016 07:14:39 +0000 (09:14 +0200)]
Fix unittests